package cn.wolfcode.web.modules.customer.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import link.ahsj.core.annotations.AddGroup;
import link.ahsj.core.annotations.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * <p>
 * 客户信息
 * </p>
 *
 * @author tangzehua
 * @since 2022-06-20
 */
@Data
@TableName("tb_customer")
public class Customer implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;

    /**
     * 企业名称
     */
    @NotBlank(message = "请输入企业名称",groups={AddGroup.class, UpdateGroup.class})
    @Length(max = 100,message = "企业名不能超过100个字",groups = {AddGroup.class,UpdateGroup.class})
    private String customerName;

    /**
     * 法定代表人
     */
    @NotBlank(message = "请输入法定代表人",groups={AddGroup.class, UpdateGroup.class})
    @Length(max = 100,message = "代表人名在30字以内",groups = {AddGroup.class,UpdateGroup.class})
    private String legalLeader;

    /**
     * 成立时间
     */
    @NotNull(message = "请选择成立法定时间",groups={AddGroup.class, UpdateGroup.class})
    private LocalDate registerDate;

    /**
     * 经营状态, 0 开业、1 注销、2 破产
     */
    @NotNull(message = "请选择营业状态",groups={AddGroup.class, UpdateGroup.class})
    private Integer openStatus;

    /**
     * 所属地区省份
     */
    @NotBlank(message = "请选择所属省份",groups={AddGroup.class, UpdateGroup.class})
    private String province;

    /**
     * 注册资本,(万元)
     */
    @NotBlank(message = "请输入注册资本",groups={AddGroup.class, UpdateGroup.class})
    private String regCapital;

    /**
     * 所属行业
     */
    @NotBlank(message = "输入所属行业",groups={AddGroup.class, UpdateGroup.class})
    @Length(max = 30,message = "所属行业在30字以内",groups = {AddGroup.class,UpdateGroup.class})
    private String industry;

    /**
     * 经营范围
     */

    @Length(max = 500,message = "经营范围在500字以内描述",groups = {AddGroup.class,UpdateGroup.class})
    private String scope;

    /**
     * 注册地址
     */

    @Length(max = 500,message = "注册地址在500字以内描述",groups = {AddGroup.class,UpdateGroup.class})
    private String regAddr;

    /**
     * 录入时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime inputTime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 录入人
     */
    @TableField(fill = FieldFill.INSERT)
    private String inputUserId;

    @TableField(exist = false)
    private String openName;

}
